#ifndef _UTILS_H_
#define _UTILS_H_

#include "sched.h"
#include "td.h"

// This file contains utilities for mapping from external to internal IDs, as
// well as other miscellaneous functions.

int Abs(int x);
int Min(int a, int b);
int Max(int a, int b);
void WakeAwaiters(sched *s, td *task, int eventid, int ret, char *event,
    int eventlen);
void SensorToExternal(char *sensor_data, char *external);
int ExternalToInternal(char *external);
void InternalToExternal(int internal, char *external);
int SwitchToInternal(int switch_number);
int InternalToSwitch(int id);
#endif
